package com.carol.lmsbe.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 设备统计响应
 */
@Data
public class EquipmentStatisticsResponse {

    // 设备总数统计
    private Long totalEquipment;
    private Long normalEquipment;
    private Long borrowedEquipment;
    private Long repairingEquipment;
    private Long scrappedEquipment;

    // 按类别统计
    private List<CategoryStatistics> categoryStatistics;

    // 按实验室统计
    private List<LaboratoryStatistics> laboratoryStatistics;

    // 按状态统计
    private List<StatusStatistics> statusStatistics;

    // 价值统计
    private BigDecimal totalValue;
    private BigDecimal averageValue;

    // 使用趋势（月度）
    private List<UsageTrend> usageTrends;

    // 维修统计
    private Long totalRepairs;
    private Long completedRepairs;
    private Long pendingRepairs;

    // 报废统计
    private Long totalScraps;
    private BigDecimal totalScrapValue;

    @Data
    public static class CategoryStatistics {
        private String category;
        private Long count;
        private BigDecimal totalValue;
    }

    @Data
    public static class LaboratoryStatistics {
        private String laboratoryName;
        private Long count;
        private BigDecimal totalValue;
    }

    @Data
    public static class StatusStatistics {
        private String status;
        private Long count;
        private String statusName;
    }

    @Data
    public static class UsageTrend {
        private String month;
        private Long borrowCount;
        private Long returnCount;
        private Long repairCount;
        
        // 月度趋势数据
        private List<String> months;
        private List<Integer> applicationCounts;
        private List<Integer> borrowCounts;
        private List<Double> usageRates;
    }
}